home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9514 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: nwgw.infi.net!usenet
  2. From: elc@fay.infi.net (Lee Carpenter)
  3. Newsgroups: comp.lang.c++
  4. Subject: Need suggestions for memory allocation - Please help...
  5. Date: 2 Mar 1996 07:04:03 GMT
  6. Organization: InfiNet
  7. Message-ID: <4h8rt3$9fe@nw003.infi.net>
  8. NNTP-Posting-Host: pa2dsp20.fay.infi.net
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.99.3
  11.  
  12. I am an amateur C programmer and have been trying to teach myself C++.  I 
  13. have recently wrote a simple database-like program for a specific purpose. 
  14. The problem is that this purpose uses huge records (2K+ per record).  I am 
  15. using a linked-list format and using 'new' to allocate memory for each new 
  16. record.  I am also using the compact memory model (1MB for the data 
  17. section).  Everything compiles fine, but when I enter about 25 records or 
  18. so, 'new' returns a NULL pointer telling me I'm out of memory.  When I 
  19. traced through the program, I found that 'new' was allocating memory near 
  20. the end of the 1MB segment and rapidly running out of memory.  Why is 
  21. this?  Is there any way I can make 'new' use more of the 1 MB of memory?  
  22. If not, is there any way I can use extended/expanded memory for data 
  23. allocation?  I'm not sure which direction to pursue.  Any advise or help 
  24. would be greatly appreciated.
  25.  
  26. Thanks in advance,
  27. Lee
  28. elc@fay.infi.net
  29.  
  30.